package com.esyoga.yoyoga.util;

import java.io.FileWriter;
import java.io.IOException;

/* *
 *类名：AlipayConfig
 */

public class AlipayConfig{

    // ↓↓↓↓↓↓↓↓↓↓请在这里配置您的基本信息↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓

    // 应用ID,您的APPID，收款账号既是您的APPID对应支付宝账号
    public static String app_id = "2016101100662278";//例：2016082600317257

    // 商户私钥，您的PKCS8格式RSA2私钥
    public static String merchant_private_key = "MIIEvAIBADANBgkqhkiG9w0BAQEFAASCBKYwggSiAgEAAoIBAQC+yG2Yj7mj55Q0aagFF7rXXKd4pJzpshSSAc3yJvxd72Iz6ENMtpNtHd7MCN16Aw65c+jfEB0q3nMwsAgLJUyrw68NOAX474IsMhXbRxBLUBmoh/PuxKsdQyHLQhjH4y5mlo4tyBRDEUGNZ7nk/mNQoXqCRBL4jVMnMqBN/FqnAkM5GERVnf9hIE1Y8InUDmkWrZYGY1Swq93ACgQSfoxy7g8mYceRyRz6Or7gFEY7J6HUthcauY6cHvfcN5uEcTyMRFXyxedT57/btt/T/u+9CeCgE/+WTVjVVwAHqMnrodC5eWy9e3tBHv6bujgo3/8A+STivq/oo3yI8zyOOOvJAgMBAAECggEAeDrtPmjND+sALiurlFIJEHG2pMPwkyID7qOuev1wq24R0C5+QxkIPYrGfoTTtnG41MykI/cOupZnt3YoC4YdFF4Esmrs8J1Xxqxls8PME/pNwTS0WHOedpl48ZQc89NKyaH1xgpCIqX8TrXgo9xhEE5DW1a1Meg2UAyKk7sGEhq3X+VNU/NJFWyywJcrR1lIT7fAzGD0YThuxg8rocQyCoLN1QRETkSwj1N7ec2VSAxHoCoMJAh3/SCO+EGztzWpQi6rTtTAptdlPEK/KjPRiok3Z4Hr/7xG1xHlmkJEtM2TC6IpBDuIQinHIk7clKrOHxNhN42pF5iUV1/f/gLgFQKBgQDdnQgWhGycqxMD0HQkIpd9PS1antghkxqVGdLgthyMaL0g5bkpWzZWOfe3MqWOVyNYdNXBPbxg/V5wcu+InHlokoKiaXV7RXypqpX2dtOG2l++u7LxosRQBNmMusLe6oy61nIVwup2QGx1a3i1P45fa+y7xAuETbL8wHScCqFKiwKBgQDcYr4PrDv45Na4vjU6Yb5UNLD6r6njscD2PqclI+RF510BXpo977UEcyQgQi/9cfgNkdM0jwpUwMvlbgAkQYhXO9zthoZFUaCSemTLNYS+Gt+Gl81WXPS3Mq4z67oFakeiZaJCKxcgATyHakw3eT/al3mjEB2mCmN/l2CQAJCxewKBgCbq7cGujbhRnqw7zjmOTZYzySQx4vi6cZ+fglXuBUNvHU+KqCKoHvmzgloMreA6Uz20ftlJsyxBMnWC6afO+s8vc3t8E6KLSGIvT9iRc4IqFUhUhA9FKz52K5I4NgKZpA8nm69QpIYRuDpCnlcOCz2coV00B2W7k2QplBDXGQ4TAoGADbyl5ioxLslszOUmQjZXe74xDd8nMscgpPiwyHLdRrIuLOitqpCnctiOduhJP338HTRqusrztOazjuB1Z80h53YWxkNtWSLGZHr2j2gNlx/rsOMDbI+svUKOczQNS0sdnfTB0WgIL/mDwVkR2R9YqJJqhYx6nJ/nJcvUvAUc/8MCgYBIyNjXHHuLKtcT2ynZfi2fu6lTsXDLNN1SZdUAaCRXPQTFFeaZxtECaLN6pwxRbGx/dLXeFDHcrRUOUBfwg5/gDZP3tWc38AUAGKD4DgBsaldEzEEGVu01kEE9HqL89O9B7m+vV14bxo4DgSPlgQXiRW955lvbFvh/5YCrQ+hp2w==";
    // 支付宝公钥,查看地址：https://openhome.alipay.com/platform/keyManage.htm
    // 对应APPID下的支付宝公钥。
    public static String alipay_public_key = "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA0shxqd1YjGGxwtd9uwFrvh5eO4Cw1rxzTZASeOqq14nxOI4Qs+VXslUaYMM7XzK5DY2JvhV7FKWyU4ZKuu+rAQLjVNU/xdS8nXz/OpAJlYDZdyQbsztGONDwt6q+7k8bKBZ7ltaNDoIwe9j6v/JmNZqxtDuIpG9Bdqlf7xXjIL5TTEe2H//lvXOADrrf2DVK2Z9qupyBZ0r1hrokOASMO4C8jaIl7pyCno6Lo+cLi1Xeg3alYrtbgFs8y2N4uyzZXqD8VsHajWgGIfdM4BXine4Aw45Aazhxr0MkviUeTuC5rjfuoaSgOBnuaIAT6Kokj/pGbirDemmUdyi4OWVjuQIDAQAB\n";
    // 服务器异步通知页面路径 需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
    /**
     * 返回的时候此页面不会返回到用户页面，只会执行你写到控制器里的地址
     */
    public static String notify_url = "http://255r210e20.zicp.vip/pay/notify";
    // 页面跳转同步通知页面路径 需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
    /**
     * 此页面是同步返回用户页面，也就是用户支付后看到的页面，上面的notify_url是异步返回商家操作，谢谢
     * 要是看不懂就找度娘，或者多读几遍，或者去看支付宝第三方接口API，不看API直接拿去就用，遇坑不怪别人
     */
    public static String return_url = "http://255r210e20.zicp.vip/pay/syn";
    // 签名方式
    public static String sign_type = "RSA2";
    // 字符编码格式
    public static String charset = "utf-8";
    // 支付宝网关
    public static String gatewayUrl = "https://openapi.alipaydev.com/gateway.do";
    // 日志地址
    public static String log_path = "D:/logs/";
    // ↑↑↑↑↑↑↑↑↑↑请在这里配置您的基本信息↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑

    /**
     * 写日志，方便测试（看网站需求，也可以改成把记录存入数据库）
     * 
     * @param sWord
     *            要写入日志里的文本内容
     */
    public static void logResult(String sWord) {
        FileWriter writer = null;
        try {
            writer = new FileWriter(log_path + "alipay_log_"
                    + System.currentTimeMillis() + ".txt");
            writer.write(sWord);
        } catch (Exception e) {
            e.printStackTrace();
        } finally {
            if (writer != null) {
                try {
                    writer.close();
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
        }
    }
}